package com.he.test;

/**
 * @description: TODO
 * @Author: HCL
 * @Date: 2024/10/24 8:43
 */
public class SyncSingletonStatic {

    //1 私有构造
    private SyncSingletonStatic(){

    }

    //2 使用私有静态内部类，去创建私有对象,并用关键字final修饰
    private static class Singleton{
        private static final SyncSingletonStatic INSTANCE = new SyncSingletonStatic();
    }

    //3 创建对象的方法
    public static SyncSingletonStatic getInstance(){
        return Singleton.INSTANCE;
    }

    public void show(){
        System.out.println("懒汉2");
    }
}
